import { onMounted } from 'vue';
import { useMapStore } from 'stores/mapStore.js'
/* store数据响应式 */
import { storeToRefs } from 'pinia';
export const initMap = () => {
    onMounted(() => {
        /* 实例化useMapStore */
        const mapStore = useMapStore()
        /* 解构并响应式 */
        const { map } = storeToRefs(mapStore)
        map.value = new ol.Map({
            target: "map",
            layers: [tdVecLayergroup, tdImgLayergroup, docLayer],
            view: new ol.View({
                projection: 'EPSG:4326',
                center: [114.37, 30.5],
                zoom: 12,
                maxZoom: 18,
                minZoom: 4,
            })
        })
    })
}

